local scroll = 6119
local temple = {x=155, y=52, z=7}
local level = 25
function onUse(cid, item, frompos, item2, topos)
if (isPlayerPzLocked(cid)) then
return doPlayerSendCancel(cid, "Você não pode se teletransportar agora!")
end
if item.itemid == scroll and getPlayerLevel(cid) >= level then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(temple,10)
doSendAnimatedText(temple, "Teleport!", 5)
doRemoveItem(cid, item.uid, 0)
else
doPlayerSendCancel(cid, "Sorry, your level must higher than 25!")
end
return 1
end
[AJUDA] Item que da TP pro templo.
By UntFrc, 13 de mar. de 2016 in Scripts
info
Group: Marquês
Joined: 18/05/11
Posts: 1.1k
Reputation: +150
Gender: Masculino

Edited Março 13 by PsyMcKenzie
info
Group: Diretor
Joined: 12/05/12
Posts: 818
Reputation: +578
Gender: Masculino
Tibia Character: [ADM] Night

Ta ai a script perfeitinha que você queria hehe, até dei uma melhorada.
local scroll = 6119 -- ID do itemlocal temple = {x=155, y=52, z=7} -- Lugar onde será teleportadolocal level = 25 -- Level minimo para poder usar o itemlocal pz = true -- players precisam estar em protection zone para usar? (true ou false)local storage = 212290 -- Storage para dar exhaustedfunction onUse(cid, item, frompos, item2, topos) if pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você precisa estar em protection zone pra poder teleportar.") end if getPlayerStorageValue(cid, storage) > os.time() then return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos.") end if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) setPlayerStorageValue(cid, storage, os.time() + 300) -- tempo em segundos. doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Desculpe, você precisa ter no minimo level "..level.." para ser teleportado.") end return TRUEend
Edited Abril 24 by nedroesdoksdja
Este está com tempo e podendo usar o item apenas em protection zone
local scroll = 6119 local temple = {x=155, y=52, z=7} local level = 25 local storage = 212290 function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storage) > os.time() then return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos.") end if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) setPlayerStorageValue(cid, storage, os.time() + 300) -- tempo em segundos. doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Sorry, your level must higher than 25!") end if config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end end
A parte de funcionar somente em PZ não funcionou.
info
Group: Diretor
Joined: 12/05/12
Posts: 818
Reputation: +578
Gender: Masculino
Tibia Character: [ADM] Night

A parte de funcionar somente em PZ não funcionou.
Desculpe, eu estou com sono e não prestei atenção kkk editei o post olha lá que agora da certo xD
Edited Março 13 by nedroesdoksdja
Desculpe, eu estou com sono e não prestei atenção kkk editei o post olha lá que agora da certo xD
Agora foi. Valeu, brother! REP+
info
Group: Marquês
Joined: 25/09/10
Posts: 1.3k
Reputation: +446
Gender: Masculino

Tópico Movido
Este tópico foi movido de "OTServ → Scripting → Downloads Scripts → Actions, talkactions e moveevents"
para "OTServ → Scripting → Suporte Scripting".
@@Dandjes, crie seus tópicos de suporte nessa seção: http://www.xtibia.com/forum/forum/86-suporte-scripting/
e quando for resolvido clique em Resolvido no post de quem te ajudou a resolver.





info
Group: Campones
Joined: 19/02/16
Posts: 95
Reputation: +27
Gender: Outro
Eai, pessoal. Bom, ultimamente eu to postando aqui quase todo dia pedindo ajuda e tudo, mas não faria se não fosse necessario (kkkkk). Então, acho que isso é a ultima ajuda que peço aqui.
Eu tenho um script aqui (action) de um item que da TP pro templo, só que eu gostaria que ele pudesse ser usado só a cada 3 minutos e o player não pudesse estar PZ, PK, REDSKULL....
O script é o seguinte:
local scroll = 6119 local temple = {x=155, y=52, z=7} local level = 25 function onUse(cid, item, frompos, item2, topos) if item.itemid == scroll and getPlayerLevel(cid) >= level then doTeleportThing(cid, temple, TRUE) doSendMagicEffect(temple,10) doSendAnimatedText(temple, "Teleport!", 5) doRemoveItem(cid, item.uid, 0) else doPlayerSendCancel(cid, "Sorry, your level must higher than 25!") end return 1 end